<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<script id="purchaseOrderPaymentTemplate" type="text/x-jquery-tmpl" th:fragment="purchaseOrderPayment">
<tr id="purOrderPaymentTemplateTr" class="edit-tr"> 
	<td colspan="5">
		<form id="editPurchaseOrderPayment">
		<input type="hidden" name="id" value="${id}" />
		<input type="hidden" name="displayOrderNo" value="${displayOrderNo}" />
		<input type="hidden" name="purchaseOrderId" value="${purchaseOrderId}" />
		<table width="100%" summay="" cellpadding="0" cellspacing="0">
			<tr>
				<td>
					<p>
						<span>付款百分比：</span> 
						<span class="m-percent-bar"> 
							<span class="m-percent-bar-status" style="width: ${percentage}%"></span>
						</span> 
						<span>${percentage}%</span>
					</p>
				</td>
				<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;描述：
					<input class="input" type="text" value="${orderPaymentRemark}" name="orderPaymentRemark" readonly="readonly"/>
				</td>
				<td></td>
			</tr>
			<tr>
				<td>
					<p class="p-calendar">
						<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;计划时间：</span> 
						<input class="input input-datepicker" type="text" value="${planTime}" name="planTime"/> <i class="icon icon-calendar"></i>
					</p>
				</td>
				<td>
					<p class="p-calendar">
						<span>实际时间：</span> 
						<input class="input input-datepicker" type="text" value="${realTime}" name="realTime"/> <i class="icon icon-calendar"></i>
					</p>
				</td>
				<td>计划金额：${currency}<input class="input" type="text" placeholder="请输入" value="${planAmount}" name="planAmount" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')"/></td>
			</tr>
			<tr>
				<td>实际开票金额：${currency}<input class="input" style="width:134px;" type="text" placeholder="请输入" value="${billedAmount}" name="billedAmount"/></td>
				<td>其中，增值税：${currency}<input class="input" style="width:115px;" type="text" placeholder="请输入" value="${increamentTax}" name="increamentTax" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')"/></td>
				<td>不含税金额：${currency}<input class="input" style="width:133px;" type="text" placeholder="请输入" value="${amountWithoutTax}" name="amountWithoutTax" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')"/></td>
			</tr>
			<tr>
				<td>
					<p class="p-indent">
						<a href="#">上传验收报告</a>
					</p>
					<p class="p-indent">
						文件名A.pdf <a href="#">- 删除文件</a>
					</p>
					<p class="p-indent">
						<a href="#">+增加验收报告</a>
					</p>
				</td>
				<td>
					<p>&nbsp;</p>
					<p class="p-indent">
						<a href="#">上传发票</a>
					</p>
					<p class="p-indent">
						文件名A.pdf <a href="#">- 删除文件</a>
					</p>
					<p class="p-indent">
						<a href="#">+增加发票</a>
					</p>
				</td>
				<td></td>
			</tr>
			<tr>
				<td colspan="3">
					<p>
						<span class="vaT">填写备注：</span>
						<textarea name="remark" cols="80" rows="5">${remark}</textarea>
					</p>
				</td>
			</tr>
			<tr>
				<td colspan="3">
					<p class="btn-bar">
						<a onclick="javascript:modifyPurchaseOrderPayment();" class="btn btn-cyan btn-small">确定修改</a>
						<a onclick="javascript:closeEditPurchaseOrderPayment();" class="btn btn-simple btn-small">取消</a>
					</p>
				</td>
			</tr>
		</table>
		</form>
	</td>
</tr>
</script>
<script id="purchaseOrderPaymentItem" type="text/x-jquery-tmpl" th:fragment="purchaseOrderPaymentItem">
<tr>
	<td id = "displayNo_${displayOrderNo}">${displayOrderNo}</td>
	<td id = "orderPaymentRemark_${displayOrderNo}">${orderPaymentRemark}</td>
	<td id = "planAmount_${displayOrderNo}">${currency}${planAmount}</td>
	<td id = "billedAmount_${displayOrderNo}">${currency}${billedAmount}</td>
	<td>
		<a onclick="javascript:openEditPurchaseOrderPayment(this, ${id}, ${displayOrderNo});"><i class="icon icon-tr-open"></i> 展开编辑</a> 
		<a onclick="javascript:closeEditPurchaseOrderPayment(this);" style="display: none;" data-trid="tr003"><i class="icon icon-tr-close"></i> 收起编辑</a>
    </td>
	{%if displayOrderNo==1%}
	<td class="vaT txL" rowspan="5" style="border-bottom: none">
		<p>
			<strong class="orange">${currency}${price}</strong>
		</p>
		<p>
			校对金额：<br /><span id="totalPlanAmount">${currency}${totalPlanAmount}</span>
		</p>
	</td>
	{%/if%}
</tr>
</script>
<script id="purchaseOrderItemTemplate" type="text/x-jquery-tmpl" th:fragment="purchaseOrderItem">
<tr>
	<input type="hidden" value="${purchaseOrderId}" name="purchaseOrderId"/>
	<input type="hidden" value="${orderItemNo}" name="orderItemNo"/>
	<td><input type="checkbox" /></td>
	<td id="orderItemNo_${orderItemNo}">${orderItemNo}</td>
	<td>
		<select id="materialId_${orderItemNo}" class="select select-w140" placeholder="商品名称" name="materialId">
		{%each materials%}
			<option value="${materialId}">${materialName}</option>
		{%/each%}
		</select>
		<a class="btn btn-cyan btn-small" style="height:20px;" onclick="javascript: addClientMaterial(this, ${orderItemNo});">新增</a>
	</td>
	<td>
		<input id="quantity_${orderItemNo}" class="w80 input" type="text" placeholder="计划数量" name="quantity" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')"/>
	</td>
	<td>
		<input id="quantityDelivered_${orderItemNo}" class="w80 input" type="text" placeholder="已发出数量" name="quantityDelivered" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')"/>
	</td>
	<td>
		<input id="quantityConfirmed_${orderItemNo}" class="w80 input" type="text" placeholder="已确认数量" name="quantityConfirmed" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')"/>
	</td>
	<td>
		<select id="unitId_${orderItemNo}" class="select select-w140" name="unitId" >
		{%each units%}
			<option value="${unitId}">${unitName}</option>
		{%/each%}
		</select>
	</td>
	<td>
		<p class="p-calendar">
			<input id="planedTime_${orderItemNo}" class="w80 input input-datepicker" type="text" name="planedTime"/>
			<i class="icon icon-calendar"></i>
		</p>
	</td>
	<td>
		<p class="p-calendar">
			<input id="actualTime_${orderItemNo}" class="w80 input input-datepicker" type="text" name="actualTime"/>
			<i class="icon icon-calendar"></i>
		</p>
	</td>
</tr>
</script>
</body>
</html>